<template>
  <div class="emr-content-module emr-content-assExam">
    <div class="h3" style="line-height: 2" id="assExam">辅助检查</div>
    <div
      class="content-wrapper content-wrapper-bodycheck"
      :class="{ locked: d.disabled }"
    >
      <div>
        肺功能检查:
        <span class="inline-block">
          <div style="display: inline-block">用力肺活量(FVC)</div>
          <el-input
            size="small"
            style="width: 80px"
            v-model="d.assExam.vitalCapacity"
            :disabled="d.disabled"
            placeholder=""
            v-number:2
          ></el-input>
          ,
        </span>
        <span class="inline-block">
          <div style="display: inline-block">一秒量(FEV1)</div>
          <el-input
            size="small"
            style="width: 80px"
            v-model="d.assExam.pulse"
            :disabled="d.disabled"
            placeholder=""
            v-number:2
          ></el-input>
          ,
        </span>
        <span>
          <div style="display: inline-block">一秒率(FEV1/FVC)</div>
          <el-input
            size="small"
            style="width: 80px"
            v-model="d.assExam.oneSecondRate"
            :disabled="d.disabled"
            placeholder=""
            v-number:2
          ></el-input>
          ,
        </span>
        <span class="inline-block">
          <div style="display: inline-block">最大呼气中期流量(MMEF75/25)</div>
          <el-input
            size="small"
            style="width: 80px"
            v-model="d.assExam.maximumRxhalation"
            :disabled="d.disabled"
            placeholder=""
            v-number:2
          ></el-input>
          ,
        </span>
        <span class="inline-block">
          <div style="display: inline-block">一氧化氮(FeNO)</div>
          <el-input
            size="small"
            style="width: 80px"
            v-model="d.assExam.FeNO"
            :disabled="d.disabled"
            placeholder=""
            v-number:2
          ></el-input>
          ppb,
        </span>
        <span class="inline-block">
          <div style="display: inline-block">一氧化氮(nNO)</div>
          <el-input
            size="small"
            style="width: 80px"
            v-model="d.assExam.NO"
            :disabled="d.disabled"
            placeholder=""
            v-number:2
          ></el-input>
          ppb,
        </span>
        <span class="inline-block">
          <div style="display: inline-block">血清IgE</div>
          <el-input
            size="small"
            style="width: 80px"
            v-model="d.assExam.IgE"
            :disabled="d.disabled"
            placeholder=""
            v-number:2
          ></el-input>
          IU/ml,
        </span>
        <span class="inline-block">
          <div style="display: inline-block">外周血嗜酸性粒细胞比例</div>
          <el-input
            size="small"
            style="width: 80px"
            v-model="d.assExam.EOSR"
            :disabled="d.disabled"
            placeholder=""
            v-number:2
          ></el-input>
          ppb,
        </span>
        <span class="inline-block">
          <div style="display: inline-block">其它检验结果</div>
          <el-input
            size="small"
            style="width: 80px"
            v-model="d.assExam.othersTest"
            :disabled="d.disabled"
            placeholder=""
            v-number:2
          ></el-input>
          ppb,
        </span>
      </div>
      <div>
        过敏原检测:
        <el-radio-group
          v-model="d.assExam.allergen"
          @change="clear(['allergenSources'])"
          :disabled="d.disabled"
        >
          <el-radio size="medium" label="0">无</el-radio>
          <el-radio size="medium" label="1">有</el-radio>
        </el-radio-group>
        <span class="inline-block">
          <el-checkbox-group
            v-if="d.assExam.allergen == '1'"
            v-model="d.assExam.allergenSources"
          >
            <div class="allergen-Item">
              <el-checkbox
                size="medium"
                :disabled="d.disabled"
                label="牛奶"
                @change="clear('milkDiagnosis')"
              ></el-checkbox>
              <el-input
                v-if="d.assExam.allergenSources.indexOf('牛奶') != -1"
                size="small"
                v-model="d.assExam.milkDiagnosis"
                maxlength="50"
                :disabled="d.disabled"
                style="width: 120px"
              ></el-input>
              <span
                v-if="d.assExam.allergenSources.indexOf('牛奶') != -1"
                style="font-size: 14px"
              >
                IU/ml
              </span>
            </div>
            <div class="allergen-Item">
              <el-checkbox
                size="medium"
                :disabled="d.disabled"
                label="鸡蛋"
                @change="clear('eggDiagnosis')"
              ></el-checkbox>
              <el-input
                v-if="d.assExam.allergenSources.indexOf('鸡蛋') != -1"
                placeholder=""
                size="small"
                v-model="d.assExam.eggDiagnosis"
                style="width: 120px"
                maxlength="50"
                :disabled="d.disabled"
              ></el-input>
              <span
                v-if="d.assExam.allergenSources.indexOf('鸡蛋') != -1"
                style="font-size: 14px"
              >
                IU/ml
              </span>
            </div>
            <div class="allergen-Item">
              <el-checkbox
                size="medium"
                :disabled="d.disabled"
                label="鱼虾"
                @change="clear('seafoodDiagnosis')"
              ></el-checkbox>
              <el-input
                v-if="d.assExam.allergenSources.indexOf('鱼虾') != -1"
                placeholder=""
                size="small"
                v-model="d.assExam.seafoodDiagnosis"
                style="width: 120px"
                maxlength="50"
                :disabled="d.disabled"
              ></el-input>
              <span
                v-if="d.assExam.allergenSources.indexOf('鱼虾') != -1"
                style="font-size: 14px"
              >
                IU/ml
              </span>
            </div>
            <div class="allergen-Item">
              <el-checkbox
                size="medium"
                :disabled="d.disabled"
                label="尘螨"
              ></el-checkbox>
              <div
                class="allergen-Item"
                v-if="d.assExam.allergenSources.indexOf('尘螨') != -1"
              >
                <el-checkbox
                  size="medium"
                  :disabled="d.disabled"
                  label="屋尘螨"
                  @change="clear('dustMitesDiagnosis1')"
                ></el-checkbox>
                <el-input
                  v-if="d.assExam.allergenSources.indexOf('屋尘螨') != -1"
                  placeholder=""
                  size="small"
                  v-model="d.assExam.dustMitesDiagnosis1"
                  style="width: 120px"
                  maxlength="50"
                  :disabled="d.disabled"
                ></el-input>
                <span
                  v-if="d.assExam.allergenSources.indexOf('屋尘螨') != -1"
                  style="font-size: 14px"
                >
                  IU/ml
                </span>
              </div>
              <div
                class="allergen-Item"
                v-if="d.assExam.allergenSources.indexOf('尘螨') != -1"
              >
                <el-checkbox
                  size="medium"
                  :disabled="d.disabled"
                  label="粉尘螨"
                  @change="clear('dustMitesDiagnosis2')"
                ></el-checkbox>
                <el-input
                  v-if="d.assExam.allergenSources.indexOf('粉尘螨') != -1"
                  placeholder=""
                  size="small"
                  v-model="d.assExam.dustMitesDiagnosis2"
                  style="width: 120px"
                  maxlength="50"
                  :disabled="d.disabled"
                ></el-input>
                <span
                  v-if="d.assExam.allergenSources.indexOf('粉尘螨') != -1"
                  style="font-size: 14px"
                >
                  IU/ml
                </span>
              </div>
            </div>
            <div class="allergen-Item">
              <el-checkbox
                size="medium"
                :disabled="d.disabled"
                label="花粉"
                @change="clear('pollenDiagnosis')"
              ></el-checkbox>
              <el-input
                v-if="d.assExam.allergenSources.indexOf('花粉') != -1"
                placeholder=""
                size="small"
                v-model="d.assExam.pollenDiagnosis"
                style="width: 120px"
                maxlength="50"
                :disabled="d.disabled"
              ></el-input>
              <span
                v-if="d.assExam.allergenSources.indexOf('花粉') != -1"
                style="font-size: 14px"
              >
                IU/ml
              </span>
            </div>
          </el-checkbox-group>
        </span>
      </div>
      <div :class="{ locked: d.disabled }">
        支气管激发试验:
        <span class="inline-block">
          <el-radio-group v-model="d.assExam.bronchialProvocationTest">
            <el-radio size="medium" label="positive" :disabled="d.disabled">
              阳性
            </el-radio>
            <el-radio size="medium" label="negative" :disabled="d.disabled">
              阴性
            </el-radio>
          </el-radio-group>
        </span>
        支气管舒张试验:
        <span class="inline-block">
          <el-radio-group v-model="d.assExam.bronchialExtensionTest">
            <el-radio size="medium" label="positive" :disabled="d.disabled">
              阳性
            </el-radio>
            <el-radio size="medium" label="negative" :disabled="d.disabled">
              阴性
            </el-radio>
          </el-radio-group>
        </span>
        ，呼气峰流速(PEF)两周波动率
        <el-input
          size="medium"
          placeholder=""
          style="width: 90px"
          :disabled="d.disabled"
          v-model="d.assExam.bronchialProvocationTestNegaVolatility"
        ></el-input>
        %，ICS和/或白三烯调节剂治疗4-12周FEV1改善率
        <span class="inline-block">
          <el-input
            size="medium"
            placeholder=""
            style="width: 90px"
            :disabled="d.disabled"
            v-model="d.assExam.maximumRxhalationImprovement"
          ></el-input>
          %
        </span>
        <span class="inline-block" v-if="d.assExam.others">
          其他
          <el-input
            size="medium"
            placeholder=""
            style="width: 90px"
            :disabled="d.disabled"
            v-model="d.assExam.others"
          ></el-input>
        </span>
      </div>
    </div>
  </div>
</template>
<script>
  import { reactive, inject } from 'vue'
  import { initAssExam } from './initTools'
  export default {
    setup() {
      const d = reactive({ disabled: false, assExam: initAssExam() })
      const clearValue = inject('clearValue')
      const checkBoxClear = function () {
        console.log('checkBoxClear')
      }
      const clear = function (val) {
        clearValue(d.assExam, val)
      }

      const getData = function () {
        return d.assExam
      }
      return {
        d,
        checkBoxClear,
        clear,
        getData,
      }
    },
  }
</script>
<style lang="scss" scoped>
  @import '@/styles/emr.scss';
</style>
